}
else if (g_strcmp0 (method_name, "GetApplication") == 0)
{
- const char *name, *path;
-
- gtk_at_spi_root_get_application (self->root, &name, &path);
-
- g_dbus_method_invocation_return_value (invocation, g_variant_new ("((so))", name, path));
+ g_dbus_method_invocation_return_value (invocation,
+ g_variant_new ("((so))", gtk_at_spi_root_to_ref (self->root)));
}
else if (g_strcmp0 (method_name, "GetChildAtIndex") == 0)
{
if (parent == NULL)
{
- const char *name, *path;
-
- gtk_at_spi_root_get_application (self->root, &name, &path);
- res = g_variant_new ("(so)", name, path);
+ res = gtk_at_spi_root_to_ref (self->root);
}
else
{
#include "gtkatspicontextprivate.h"
#include "gtkatspiprivate.h"
+#include "gtkatspiutilsprivate.h"
#include "gtkdebug.h"
#include "gtkwindow.h"
return self->cache;
}
-void
-gtk_at_spi_root_get_application (GtkAtSpiRoot *self,
- const char **name,
- const char **path)
+/*< private >
+ * gtk_at_spi_root_to_ref:
+ * @self: a #GtkAtSpiRoot
+ *
+ * Returns an ATSPI object reference for the #GtkAtSpiRoot node.
+ *
+ * Returns: (transfer floating): a #GVariant with the root reference
+ */
+GVariant *
+gtk_at_spi_root_to_ref (GtkAtSpiRoot *self)
{
- g_return_if_fail (GTK_IS_AT_SPI_ROOT (self));
+ g_return_val_if_fail (GTK_IS_AT_SPI_ROOT (self), NULL);
+
+ if (self->desktop_path == NULL)
+ return gtk_at_spi_null_ref ();
- if (name != NULL)
- *name = self->desktop_name;
- if (path != NULL)
- *path = self->desktop_path;
+ return g_variant_new ("(so)", self->desktop_name, self->desktop_path);
}
GtkAtSpiCache *
gtk_at_spi_root_get_cache (GtkAtSpiRoot *self);
-void
-gtk_at_spi_root_get_application (GtkAtSpiRoot *self,
- const char **name,
- const char **path);
+GVariant *
+gtk_at_spi_root_to_ref (GtkAtSpiRoot *self);
G_END_DECLS